<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生信息管理系统</title>
    <link rel="shortcut icon" href="../static/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="../static/static/css/font.css">
    <link rel="stylesheet" href="../static/static/css/weadmin.css">
    <script src="../static/lib/layui/layui.js" charset="utf-8"></script>
</head>
<body>

<div class="login">
    <h1 style="align-content: center">********修改密码********</h1>
    <br>

    <input id="password" placeholder="新密码" type="password" lay-verify="required" class="layui-input">
    <hr class="hr15">
    <input id="passwords" lay-verify="required" placeholder="确认密码" type="password" class="layui-input">
    <hr class="hr15">
    <button style="width:100%;" class="layui-btn layui-btn-lg layui-btn-normal" onclick="updatePwd()">修改密码</button>
    <hr class="hr20">

</div>
<script type="text/javascript" src="../static/jquerymini.js"></script>
<script type="text/javascript">
    function updatePwd() {

        password = document.getElementById("password").value;
        passwords = document.getElementById("passwords").value;
        $.ajax({
                url: '/updatePwd/',
                method: 'post',
                data: {'password': password, 'passwords': passwords},
                dataType: 'JSON',
            }
        );
       location.assign('http://127.0.0.1:8000/login/')
    }

    layui.use(['form', 'admin'], function () {
        var form = layui.form
            , admin = layui.admin;
        // layer.msg('玩命卖萌中', function(){
        //   //关闭后的操作
        //   });
        //监听提交
        //监听提交
        form.on('submit(update)', function (data) {

            return false;
        });
    });
</script>
</body>
</html>